﻿Imports Runa.Core
Imports Runa.Common.Helper

Namespace Global.Runa.UI.Navigation

    Public Class NavigationContext

        Public Property QueryString As System.Collections.Generic.Dictionary(Of String, String)

        Public Sub New()
            Me.QueryString = New System.Collections.Generic.Dictionary(Of String, String)
        End Sub

        Public Sub New(ByVal u As Uri)
            Me.QueryString = New System.Collections.Generic.Dictionary(Of String, String)
            Dim q = u.Query
            Dim items = q.Split(","c)
            For Each item In items
                Dim key = item.GetLeft("=").Trim()
                Dim value = Uri.UnescapeDataString(item.GetRight("=").Trim())
                Me.QueryString.Add(key, value)
            Next
        End Sub

    End Class

End Namespace